﻿window.onload = () => {

    //获取背景div
    let background = document.getElementById("views");                     //获取 flowView div

    //创建画布
    let svg: SVGSVGElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
    let rect: SVGRectElement = document.createElementNS("http://www.w3.org/2000/svg", "rect") as SVGRectElement;
    let g: SVGGElement = document.createElementNS("http://www.w3.org/2000/svg", "g") as SVGGElement;
    let use: SVGUseElement = document.createElementNS("http://www.w3.org/2000/svg", "use") as SVGUseElement;
    let use1: SVGUseElement = document.createElementNS("http://www.w3.org/2000/svg", "use") as SVGUseElement;
    let use2: SVGUseElement = document.createElementNS("http://www.w3.org/2000/svg", "use") as SVGUseElement;
    g.setAttribute("id", "shape1");
    svg.setAttribute("width", "1000");
    svg.setAttribute("height", "1000");
    use.setAttribute("xlink:href", "#shape1");
    use.setAttribute("x", "100");
    use.setAttribute("y", "100");
    use.setAttribute("class", "codrops-1");
    use1.setAttribute("x", "200");
    use1.setAttribute("x", "200");
    use1.setAttribute("xlink:href", "#shape1");
    use2.setAttribute("x", "500");
    use2.setAttribute("x", "500");
    use2.setAttribute("xlink:href", "#shape1");
    rect.setAttribute("x", "25");
    rect.setAttribute("y", "25");
    rect.setAttribute("style", "fill:#bf55ec;");
    rect.setAttribute("width", "55");
    rect.setAttribute("height", "55");
    g.appendChild(rect);
    svg.appendChild(g);
    svg.appendChild(use);
    svg.appendChild(use1);
    svg.appendChild(use2);
    background.appendChild(svg);


};

